<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@page import="com.joinlabs.entity.Wares"%>
<%@page import="com.joinlabs.entity.Img"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("path", path);	
%>

<!DOCTYPE html>
<html>
    <head>
    	<script type="text/javascript" src="/common/js/jquery-1.11.3.js" charset="utf-8" ></script>
    	<link href='/common/css/product/style.css' rel="stylesheet" type="text/css" />
    	
    	<link rel="stylesheet" href="/common/layui/css/layui.css" media="all">
		<script src="/common/layui/layui.js" charset="utf-8"></script>
		
		<script type="text/javascript">
			var assessUsertext = "";
			var assessLevel = 0;
			var waresId = 0;
			var userId ="";
			var orderItemid = 0;
			
			$(document).ready(function() {
				$("#addlevel").click(function() {
					
					assessUsertext = $("#kiatext").val();
					
					assessLevel = $(".layui-inline").text().substring(0,1);
					waresId = ${orderitem.waresId};
					userId = "522624199803224453";
					orderItemid = ${orderitem.orderItemid};
				
					location.href = "/product/commitlevel?assessUsertext="+assessUsertext+"&assessLevel="+assessLevel+"&waresId="+waresId+"&userId="+userId+"&orderItemid="+orderItemid+"";

				}) 
				

			});	
		</script>
		
		<style type="text/css">
/* reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0}
fieldset,img{border:0;}
:focus{outline:0;}
ol,ul{list-style:none;list-style-position:outside;}
table{border-collapse:collapse;border-spacing:0;}
address,caption,cite,code,dfn,em,i,strong,th,var,optgroup{font-style:normal;font-weight:normal;}
body,button,input,select,textarea{font:12px/1.5 微软雅黑,arial,sans-serif;}
button,input,select,textarea,h1,h2,h3,h4,h5,h6{font-size:100%;}
body{color:#333;min-width: 1120px;}
a{color:#333;text-decoration:none;}
a:hover{color:#f60;text-decoration:underline;}
a:hover em,a:hover i,a:hover span{cursor:pointer;}
.cf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
.cf{*zoom:1;}

/*** guide ***/
.guide{width:60px;margin-left:770px;position:fixed;left:50%;bottom:134px;_position:absolute;_top:expression(documentElement.scrollTop+documentElement.clientHeight - this.clientHeight - 134+'px');display:block;}
.guide a{display:block;width:60px;height:50px;background:url(http://localhost:8083/fileserver/wares/sprite_v2.png) no-repeat;margin-top:10px;text-decoration:none;font:16px/50px "Microsoft YaHei";text-align:center;color:#fff;border-radius:2px;}
.guide a span{display:none;text-align:center;}
.guide a:hover{text-decoration:none;background-color:#39F;color:#fff;}
.guide a:hover span{display:block;width:60px;background:#39F}
.guide .find{background-position:-84px -236px;}
.guide .report{background-position:-146px -236px;}
.guide .edit{background-position:-83px -185px;}
.guide .top{background-position:-145px -185px;}
</style>
		
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>商品评价</title>
      
    </head>
    <body>
    
    <c:if test="${sessionScope.usercolor == null}">
		<header id="backcolor1" style="background: #671B0D;">
		</c:if>
		<c:if test="${sessionScope.usercolor != null}">
		<header id="backcolor1" style="background:${sessionScope.usercolor};">
		</c:if>
			<div class="top center">
				<div class="left fl">
					<ul>
						<li>
							<a href="/user/loginreg/index" target="_blank">JoinLabs商城</a>
						</li>
						<li>|</li>
						<li>
							<a href="/product/fytype">Joinlabs全部商品</a>
						</li>
						<li>|</li>
						<li>
							<a href="">JY聊</a>
						</li>
						<li>|</li>
						<li>
							<a href="">JY游戏</a>
						</li>
						<li>|</li>
						<li>
							<a href="">JY阅读</a>
						</li>
						<li>|</li>
						<li>
							<a href="">JY服务</a>
						</li>
						<li>|</li>
						<li>
							<a href="">JY金融</a>
						</li>
						<li>|</li>
						<li>
							<a href="">JY商城移动版</a>
						</li>
						<li>|</li>
						<li>
							<a href="">风格</a>	
						</li>
						
						<li>
							
							 <div id="test1"></div>
							 <script>
								layui.use('colorpicker', function(){
								  var $ = layui.$
								  ,colorpicker = layui.colorpicker;
								  //常规使用
								  colorpicker.render({
								    elem: '#test1' //绑定元素
								    ,change: function(color){ //颜色改变的回调
								    	//console.log(color);
								    	$("#backcolor1").attr("style","background: "+color+";");
								    	$("#backcolor2").attr("style","margin-top: 100px;background:"+color+";color:#B0B0B0;");
								    	$("#jrgwc1").attr("style","background: "+color+";");
										
								    	
								    },done: function(color){
								        console.log(color)
								       
								        $.post("/product/procolor", {
											"usercolor": color,
										}, function(data) {
											if(data == "success") {
												alert("选择颜色成功,有眼光呀！");

											}else{
												alert("选择失败，其实默认色挺好的");
											}
										});
								        
								      }
								  });
								});
								</script>
						</li>
						<div class="clear"></div>
					</ul>
				</div>
				<div class="right fr">
					<div class="gouwuche fr">
						<a href="/shopcar/show">购物车</a>
					</div>
					<div class="fr">
						
					</div>
					<div class="clear"></div>
				</div>
				<div class="clear"></div>
			</div>
		</header>
		<!--end header -->

		<!-- start banner_x -->
		<div class="banner_x center fr" style="margin-right:20%;">
			
			<a href="${path}/index">
				<div class="ad_top fl"><img src="http://localhost:8083/fileserver/wares/logo1.jpg" style="width:200px;height: 100%;"></div>
			</a>
			<div class="nav fl">
				<ul>
					<li><a href="/product/showtype?tid=1">手机</a></li>
					<li><a href="/product/showtype?tid=2">数码</a></li>
					<li><a href="/product/showtype?tid=3">家电</a></li>
					<li><a href="/product/showtype?tid=4">家居</a></li>
					<li><a href="/product/showtype?tid=5">服饰</a></li>
					<li><a href="/product/showtype?tid=6">食品</a></li>
					<li><a href="/product/showtype?tid=7">图书</a></li>
					<li><a href="/product/showtype?tid=8">鞋子</a></li>
					<li><a href="/product/showtype?tid=9">首饰</a></li>
				</ul>
			</div>
			<div class="search fr">
				<form action="/product/selectlike" method="post">
					<div class="text fl">
						<input type="text" class="shuru" placeholder="JAVA大数据&nbsp;UI设计" name="likeName" style="border-bottom: 1px solid;">
					</div>
					<div class="submit fl">
						<input type="submit" class="sousuo" value="搜索" />
					</div>
					<div class="clear"></div>
				</form>
				<div class="clear"></div>
			</div>
		</div>
    	
	<div class="xiangqing fl"  style="border-top: 1px solid #B0B0B0;">
		<div class="neirong w">
			<div class="xiaomi6 fl"><span id="pro-xiangq-name">
				欢迎${sessionScope.user.userName}
			</span></div>
			<nav class="fr">
						<div id="" class="fr">

							<li class="fr" id="tiaozhuangaishu">
								<a href="/product/proskr?waresId=${waresId}">概述</a>
							</li>
							<li>|</li>
							<li class="fr" id="tiaozhuancanshu">
								<a href="/product/proconfig?waresId=${waresId}">参数</a>
							</li>
							<li>|</li>
							<li class="fr">
								<a href="/product/prolevel?waresId=${waresId}">商品评价</a>
							</li>
							
							<div class="clear"></div>
						</div>
						
					</nav>
			<div class="clear"></div>
		</div>	
	</div>
	
	<!-- 快捷按钮  -->
		<div class="guide">
			<div class="guide-wrap">
				<a href="/user/loginreg/index" class="edit" title="首页"><span>首页</span></a>
				<a href="/product/addtest" class="find" title="地图"><span>地图</span></a>
				<a href="/product/fytype" class="report" title="all商品"><span>all商品</span></a>
				<a href="javascript:window.scrollTo(0,0)" class="top" title="回顶部"><span>回顶部</span></a>
			</div>
		</div>
	
	
	
	<c:if test="${exist == 0}">
	<div id="" style="background: #FFFFFF;width:100%;margin-left:700px;margin-top:300px;">
	
				<div class="mingxing fl mb20" style="margin-left:30px;border:2px solid #fff;width:230px;cursor:pointer;margin-right:14px;" onmouseout="this.style.border='2px solid #fff'" onmousemove="this.style.border='2px solid red'">
					<div class="sub_mingxing"><a href="/product/pro?pid=${orderitem.waresId}" target="_blank"><img src="http://localhost:8083/fileserver/wares/${orderitem.imgpath}" alt="" style="width:200px;height:200px;"></a></div>
						</div>
				
				<div style="font-size:18px">
					<div style="margin-top:100px;">商品名字：<span style="color:red">${orderitem.waresName}</span></div>
					
					<div style="margin-top:10px;">购买的型号：<span style="color:red">${orderitem.waresEdition}</span></div>
					<div class="youhui" style="margin-left:55px">颜色：<span style="color:red">${orderitem.waresColor}</span></div>
					<div class="jiage" style="margin-left:55px">价格：<span style="color:red">${orderitem.orderPrice}</span>元</div>
				</div>
		
				<div id="test3" style="margin-top:20px"></div>
				 <div class="layui-form-item layui-form-text">
    <label class="layui-form-label" style="font-size:20px">评价:	</label>
    <div class="layui-input-block">
      <textarea placeholder="请对本商品进行评价" class="layui-textarea" name="desc" style="width:300px;font-size:18px" id="kiatext"></textarea>
    </div>
  </div>
		<script>
			layui.use('rate', function() {
				var rate = layui.rate;

				  	rate.render({
				    elem: '#test3'
				    ,value:3
				    ,text: true //开启文本
				  });
			});
		</script>	
		
		<div class="clear"></div>
			
		</div>
		
		<div class="xiadan ml20 mt20" style="margin: 20px 45%;position:fixed; left:0px; bottom:0px; width:100%; height:50px; z-index:9999;">
		
		<input class="jrgwc" type="button" name="jrgwc" value="评价" id="addlevel"/>

	</div>
		
	</c:if>
	
	<c:if test="${exist == 1}">
	<div id="" style="background: #FFFFFF;width:100%;margin-left:37%;margin-top:300px;">
	
				<div class="mingxing fl mb20" style="margin-left:30px;border:2px solid #fff;width:230px;cursor:pointer;margin-right:14px;" onmouseout="this.style.border='2px solid #fff'" onmousemove="this.style.border='2px solid red'">
					<div class="sub_mingxing"><a href="/product/pro?pid=${orderitem.waresId}" target="_blank"><img src="http://localhost:8083/fileserver/wares/${orderitem.imgpath}" alt="" style="width:200px;height:200px;"></a></div>
						</div>
				
				<div style="font-size:18px">
					<div style="margin-top:100px;">商品名字：<span style="color:red">${orderitem.waresName}</span></div>
					
					<div style="margin-top:10px;">购买的型号：<span style="color:red">${orderitem.waresEdition}</span></div>
					<div class="youhui" style="margin-left:55px">颜色：<span style="color:red">${orderitem.waresColor}</span></div>
					<div class="jiage" style="margin-left:55px">价格：<span style="color:red">${orderitem.orderPrice}</span>元</div>
				</div>
		
				<div id="test3" style="margin-top:20px"></div>
				 <div class="layui-form-item layui-form-text">
    
    <div class="layui-input-block">
    </div>
     <span style="font-size:20px;margin-left:70px">您已评价过该商品：<span style="color:red">${ass.assessUsertext}</span></span>
  </div>
		<script>
			layui.use('rate', function() {
				var rate = layui.rate;

				  	rate.render({
				    elem: '#test3'
				    ,value: ${ass.assessLevel}
				    ,readonly: true
				    ,text: true //开启文本
				  });
			});
		</script>		
		
		<div class="clear"></div>
			
	
		</div>
		
		
		
		<div class="xiadan ml20 mt20" style="margin: 20px 45%;position:fixed; left:0px; bottom:0px; width:100%; height:50px; z-index:9999;">
		<a href="/product/prolevel?waresId=${orderitem.waresId}&count=${count}">
		<input class="jrgwc" type="button" name="jrgwc" value="查看评价" />
		</a>
	</div>
		
	</c:if>
	

	
	
	
	
 	</body>
</html>